package com.szcinda.call;

import com.szcinda.call.service.LoginDto;
import com.szcinda.call.service.SiteUserService;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping({"user"})
public class SiteUserController {
    private final SiteUserService siteUserService;

    public SiteUserController(SiteUserService siteUserService) {
        this.siteUserService = siteUserService;
    }

    // 登录
    @PostMapping("login")
    public Result<String> login(@RequestBody LoginDto loginDto) {
        return siteUserService.login(loginDto);
    }

    // 检查点数是否足够
    @GetMapping("check/{userName}")
    public Result<String> check(@PathVariable String userName) {
        return siteUserService.check(userName);
    }
}
